package com.xuecheng.content.contrller;


import com.xuecheng.content.model.dto.CoursePreviewDto;
import com.xuecheng.content.service.iml.CoursePublishServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(value = "课程公开查询接口",tags = "课程公开查询接口")
@RestController
@RequiredArgsConstructor
@Slf4j
@RequestMapping("/open")
public class CourseOpenController {

    private final CoursePublishServiceImpl coursePublishService;


    @ApiOperation("获取课程信息")
    @GetMapping("/course/whole/{courseId}")
    public CoursePreviewDto preview(@PathVariable("courseId") Long courseId){
        log.info("课程预览~~~");
       return  coursePublishService.getCoursePreviewInfo(courseId);
    }

}
